import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:online_study/mine/integral/integral_center.dart';
import 'package:online_study/mine/user_details.dart';
import 'package:online_study/theme/colors.dart';
import 'package:online_study/theme/size.dart';

//我的信息
class MyInfoPage extends StatefulWidget {
  @override
  _MyInfoPageState createState() => _MyInfoPageState();
}

class _MyInfoPageState extends State<MyInfoPage> {
  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.symmetric(horizontal: ThemeSize.width19),
      margin: EdgeInsets.symmetric(
          vertical: ThemeSize.height16, horizontal: ThemeSize.width9),
      decoration: BoxDecoration(
          color: ThemeColor.color1485EE,
          borderRadius: BorderRadius.circular(ThemeSize.height8)),
      child: Column(
        children: [
          Container(
            margin: EdgeInsets.only(top: ThemeSize.height20),
            child: Row(
              children: [
                GestureDetector(
                  child: Container(
                    height: ThemeSize.height60,
                    width: ThemeSize.height60,
                    decoration: BoxDecoration(
                        image: DecorationImage(
                            image: NetworkImage(
                                "https://flutter.github.io/assets-for-api-docs/assets/widgets/owl-2.jpg"),
                            fit: BoxFit.cover),
                        shape: BoxShape.circle),
                  ),
                  onTap: () {
                    Get.to(() => UserDetailsPage());
                  },
                ),
                Expanded(
                    child: Container(
                  alignment: Alignment.topLeft,
                  padding: EdgeInsets.only(left: ThemeSize.width19),
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Container(
                        margin: EdgeInsets.only(bottom: ThemeSize.height6),
                        child: Text("朱亚文",
                            style: TextStyle(
                                color: ThemeColor.colorWhite,
                                fontSize: ThemeSize.sp16)),
                      ),
                      GridView.builder(
                        gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
                            crossAxisCount: 6,
                            mainAxisSpacing: ThemeSize.width5,
                            crossAxisSpacing: ThemeSize.width5),
                        itemBuilder: (BuildContext context, int index) {
                          return Container(
                            height: ThemeSize.height20,
                            width: ThemeSize.height20,
                            child: Image.network(
                                "https://flutter.github.io/assets-for-api-docs/assets/widgets/owl-2.jpg",
                                fit: BoxFit.cover),
                          );
                        },
                        itemCount: 3,
                        physics: NeverScrollableScrollPhysics(),
                        shrinkWrap: true,
                      )
                    ],
                  ),
                ))
              ],
            ),
          ),
          Container(
            margin: EdgeInsets.only(
                top: ThemeSize.height16, bottom: ThemeSize.height18),
            child: Row(
              children: [
                Expanded(
                    child: Text("我的积分:1688",
                        style: TextStyle(
                            color: ThemeColor.colorWhite,
                            fontSize: ThemeSize.sp16))),
                GestureDetector(
                  child: Text("积分明细",
                      style: TextStyle(
                          color: ThemeColor.colorWhite,
                          fontSize: ThemeSize.sp13)),
                  onTap: () {
                    Get.to(() => IntegralCenterPage());
                  },
                )
              ],
            ),
          )
        ],
      ),
    );
  }
}
